---
title: "Phone Call Meta-Analysis"
author: "Jose S. Gomez"
date: "8/12/2023"
output: html_document
---

```{r, setup, include=FALSE}
rm(list=ls())       # clear objects in memory
knitr::opts_knit$set(root.dir = '/Users/gomez/Library/CloudStorage/Dropbox/GOTV V/Replication Files/Data') #Set Working Directory
```
#setup clean working environment, packages and data
```{r}
library(foreign) 
library(metafor) # meta-analysis package
phone_data <- read.csv("GOTV V Phone Data (Overall Collapsed).csv")
```

#Appendix C estimates in order of thier appearance within the book:
```{r}
#volunteer calls
rma(yi = Meta_b[phone_data$RoboVolunteerProfessional == 2], 
                     sei= Meta_SE[phone_data$RoboVolunteerProfessional == 2], 
                     method = "DL", 
                     data = phone_data)

#commercial calls
rma(yi = Meta_b[phone_data$RoboVolunteerProfessional == 3], 
                     sei= Meta_SE[phone_data$RoboVolunteerProfessional == 3], 
                     method = "DL", 
                     data = phone_data)

#robo calls overall
rma(yi = Meta_b[phone_data$RoboVolunteerProfessional == 1], 
                               sei= Meta_SE[phone_data$RoboVolunteerProfessional == 1], 
                               method = "DL", 
                               data = phone_data) 

#robo calls no social pressure
rma(yi = Meta_b[phone_data$RoboVolunteerProfessional == 1 & phone_data$SocialPressure == 0], 
                               sei= Meta_SE[phone_data$RoboVolunteerProfessional == 1 & phone_data$SocialPressure == 0], 
                               method = "DL", 
                               data = phone_data) 

#robo calls social pressure only
rma(yi = Meta_b[phone_data$RoboVolunteerProfessional == 1 & phone_data$SocialPressure == 1], 
                               sei= Meta_SE[phone_data$RoboVolunteerProfessional == 1 & phone_data$SocialPressure == 1], 
                               method = "DL", 
                               data = phone_data) 
```